package com.socialuni.common.user.sdk.manage;

import com.socialuni.common.user.sdk.repository.CommonUserRepository;
import com.socialuni.uniapp.sdk.model.UniProviderLoginQO;
import com.socialuni.common.user.model.DO.CommonUserDO;
import com.socialuni.common.user.sdk.utils.model.CommonUserDOUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class CommonUserDOCreate {
    @Resource
    CommonUserRepository userRepository;

    public CommonUserDO create(UniProviderLoginQO loginQO) {
        CommonUserDO user = CommonUserDOUtil.providerLoginQOToDO(loginQO);
        user = userRepository.save(user);
        return user;
    }
}